/**
 * Author: Shen Yanqiu
 * Date: 2017-12-18
 * Time: 11:13
 *
 */
import React from 'react';
import { connect } from "dva";
import PropTypes from 'prop-types';
import { Page } from 'components';
import queryString from "query-string";
import  Details from './Subpage/Details';
import { routerRedux } from 'dva/router';

class ActivityDetails extends React.Component {
  static propTypes = {
    loading: PropTypes.object,
    dispatch: PropTypes.func,
    examine: PropTypes.object,
    location: PropTypes.object,
    detailsInfo: PropTypes.object,
  };
  componentWillMount () {
    const { match, dispatch } = this.props;
    const id = match.params.id;
    dispatch({
      type: 'examine/refreshDetails',
      payload: { id },
    });
  }
  render () {
    const { loading, location, examine, dispatch, match } = this.props;
    const { detailsInfo } = examine;
    const submitExamine = (values) => {
      dispatch({
        type: 'examine/submitExamine',
        payload: { values },
      });
    };
    // examine
    return (
      <Page loading={loading.models.examine}>
        <Details {...detailsInfo} submitExamine={submitExamine} />
      </Page>
    );
  }
}

export default connect(({ loading, examine }) => ({ loading, examine }))(ActivityDetails);
